import BuffUtil from '@/BuffUtil';
import AbilityBase from 'code/Scripts/Abilities/base/AbilityBase';
/**
 * 熊怪 - 伤痕
 **/
export default class MSK_Herted extends AbilityBase {
    static instance: MSK_Herted;
    buffType: AppBuffType = {
        id: 'buff_MSK_Herted',
        art: this.art,
        name: this.abilityName,
        ubertip: this.ubertip,
        stackCountMax: -1,
        dur: 12,
        isDebuff: true,
    };
    constructor(id: string = 'Mxt0') {
        super(id);
        MSK_Herted.instance = this;
        this.init();
        EventManager.onTakeAttack(this.onSpellEffect.bind(this));
    }
    init() {
        BuffUtil.registerBuffType(this.buffType);
    }
    cast<T extends Object = any>(tarX: number, tarY: number, source: unit, target: unit, data?: T): void {
        let buff = BuffUtil.addBuff(target, this.buffType.id, source, null);
        // @ts-ignore
        data.lastDamage += buff.stackCount * 25;
    }
    onSpellEffect(d: DamageEventData) {
        if (GetUnitAbilityLevel(d.source, this.id) == 0) return;
        let buff = BuffUtil.addBuff(d.target, this.buffType.id);
        d.lastDamage += buff.stackCount * 25;
    }
}
